interface IFn1<R> {
  (len: number, str: R): R[];
}
// 把泛型参数提前到接口名上, 声明类型注解时 使用 接口<any>
const greeter3: IFn1<string> = <R>(len: number, value: R): R[] => {
  const arr: R[] = [];
  for (var i = 0; i < len; i++) {
    arr[i] = value;
  }
  return arr;
};
console.log(greeter3(3, "测试"));
